import axios from '@/utils/request'
// 1 封装用户登录事件 
export const userLogin = (data) => {
    return axios({
        method: 'post',
        url: '/login',
        data
    })
}
// 2 封装用户注册方法 
export const userRegister = (data) => {
    return axios({
        method: 'post',
        url: '/register',
        data
    })
}

// 3 获取用户数据
export const getUserDetail = (id) => {
    return axios({
        method: 'get',
        url: `/user/${id}`,
    })
}
// 4 文件上传
export const postFile = (data) => {
    return axios({
        method: 'post',
        url: '/upload',
        data
    })
}

// 5 获取用户信息
export const getUserInfo = (id) => {
    return axios({
        url: `/user/${id}`,
    })
}
// 6 编辑用户信息
export const updateUserInfo = (id, data) => {
    return axios({
        method: 'post',
        url: `/user_update/${id}`,
        data
    })
}